<?php
if (! defined ( 'BASEPATH' ))
	exit ( 'No direct script access allowed' );
class region extends CI_Controller {
	public function __construct() {
		parent::__construct ();
	}
	public function get_regions() {
		$region_id = $this->input->get ( 'region_id' );
		if ($region_id == null) {
			$region_id = 0;
		}
		$this->load->model ( "region_model" );
		$regions = $this->region_model->query_region_list ( $region_id );
		if (!$regions) {
			$regions=array();
		}
		echo json_encode ( $regions );
	}
	public function get_highways() {
		$region_id = $this->input->get ( 'region_id' );
		if ($region_id == null) {
			$region_id = 0;
		}
		$this->load->model ( "region_model" );
		$regions = $this->region_model->get_highways ( $region_id );
		if (!$regions) {
			$regions=array();
		}
		echo json_encode ( $regions );
	}
	public function get_airports() {
		$region_id = $this->input->get ( 'region_id' );
		if ($region_id == null) {
			$region_id = 0;
		}
		$this->load->model ( "region_model" );
		$regions = $this->region_model->get_airports ( $region_id );
		if (!$regions) {
			$regions=array();
		}
		echo json_encode ( $regions );
	}
}